<template>
  <view class="share">
		<image class="bg-set" src="../../static/global-bg.jpg" mode="widthFix"></image>
    <view class="share-tab">
      <view class="share-tab-title">
        <view class="title-inner">
          <uni-segmented-control
            :current="current"
            :values="items"
            @clickItem="onClickItem"
            style-type="text"
            active-color="#fa541c"
          ></uni-segmented-control>
        </view>
      </view>
    </view>
    <view class="share-tab-content">
			<view v-if="current === 0">
			  <archives-week></archives-week>
			</view>
        <view v-if="current === 1">
          <archives-month></archives-month>
        </view>
        <view v-if="current === 2">
          <archives-year></archives-year>
        </view>
    </view>
  </view>
</template>

<script>
import ArchivesYear from './archives-year.vue'
import ArchivesMonth from './archives-month.vue'
import ArchivesWeek from './archives-week.vue'
import {uniSegmentedControl} from '@/components/uni-segmented-control/uni-segmented-control.vue'
export default {
  components: {
    uniSegmentedControl,
		ArchivesYear,
		ArchivesMonth,
		ArchivesWeek,
  },
  onLoad() {
    console.log(this.current)
  },
  data() {
    return {
      items: ['周','月','年'], // 头部导航条目
      current: 0, // 当前导航索引
    }
  },
  methods: {
		onClickItem(e) {
			if (this.current !== e.currentIndex) {
					this.current = e.currentIndex;
			}
		},
  }
}
</script>
<style lang='scss'>
  .share {
    .share-tab {
      .share-tab-title {
        position: relative;
        .title-inner {
          width: 70%;
          margin: 0 auto;
					color: #FFFFFF;
        }
      }
    }
  }
</style>
